<?php
$j = 1;
function foo(){
    $j = 2;
    var_dump($j);   //2
}
foo();
var_dump($j);    //1



